<template>
  <div :class="['box', { navpos: scrolltop }]">
    <div class="container">
      <div class="logo">
        <a href="#">
          <img src="../../assets/logo.png" alt="" />
        </a>
      </div>
      <div class="nav">
        <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
        >
          <el-submenu index="Home">
            <template slot="title">Home</template>
            <el-menu-item index="Home">Home1</el-menu-item>
            <el-menu-item index="2-2">Home2</el-menu-item>
            <el-menu-item index="2-3">Home3</el-menu-item>
          </el-submenu>
          <el-submenu index="FAQ">
            <template slot="title">Pages</template>
            <el-menu-item index="FAQ">FAQ</el-menu-item>
            <el-menu-item index="2-2">GALLey</el-menu-item>
            <el-menu-item index="2-3">TEMA</el-menu-item>
          </el-submenu>
          <el-menu-item index="About">News</el-menu-item>
          <el-submenu index="Explore">
            <template slot="title">Explore</template>
            <el-menu-item index="Explore">Explore1</el-menu-item>
            <el-menu-item index="3-2">Explore2</el-menu-item>
            <el-menu-item index="3-3">Explore3</el-menu-item>
          </el-submenu>
        </el-menu>
      </div>
      <div class="phone">
        <div class="phoneimg">
          <img src="../../assets/header-icon.png" alt="" />
        </div>
        <div>
          <span class="call">Call Anytime</span>
          <p>666 888 0000</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['scrolltop'],
  data() {
    return {
      activeIndex: '1',
    }
  },
  methods: {
    handleSelect(key) {
      this.$store.commit('RESET_ACT', key)
    },
  },
}
</script>

<style lang="scss">
.box {
  width: 100%;
  height: 110px;
  background: #fff;
  .container {
    width: 1200px;
    height: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .el-submenu__title i {
      display: none;
    }
    .el-menu-demo {
      border: none;
    }
    .is-active {
      border: none;
    }
  }
}
.phone {
  display: flex;
  .phoneimg {
    margin-right: 20px;
  }
  .call {
    font-size: 14px;
    color: #858694;
  }
}
.navpos {
  transition: all 0.5s;
  position: fixed;
  top: 0;
  z-index: 1000000;
  left: 0;
}
</style>
